Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support start time parameter on read changes #443

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ryanpq
Copy link

@ryanpq ryanpq commented Jan 23, 2025

Description

Adds support for start_time parameter in read changes

References

openfga/go-sdk#158

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@ryanpq ryanpq requested review from a team as code owners January 23, 2025 19:06
Copy link

stacklok-cloud bot commented Jan 30, 2025

Minder Vulnerability Report ✅

Minder analyzed this PR and found it does not add any new vulnerable dependencies.

Vulnerability scan of 17d722da:

  • 🐞 vulnerable packages: 0
  • 🛠 fixes available for: 0

feat: support start time parameter on read changes
@ryanpq ryanpq force-pushed the feat-support-start-time-parameter-on-read-changes branch from 20718e8 to a1f7cbb Compare January 31, 2025 15:18
Copy link
Member

@ewanharris ewanharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a query around the format the CLI accepts

README.md Outdated Show resolved Hide resolved
if startTime != "" {
layout := "2006-01-02T15:04:05Z"

parsedTime, err := time.Parse(layout, startTime)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be using time.RFC3339 here as that's what we use in the go-sdk, or is the 2006-01-02T15:04:05Z07:00 format a little bit too lengthy to write out on the CLI?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API docs call for ISO8601 which in go requires a layout variable as it differs slightly from RFC3339. The go-sdk expects input to be a time.Time object but since we're taking text input in the CLI this ensures that ISO8601 is properly supported as detailed in the API documentation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh my bad, I overlooked we were just using that in the tests

Co-authored-by: Ewan Harris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants